Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow refactor #588

Merged
merged 60 commits into from
Jul 27, 2023
Merged

Workflow refactor #588

merged 60 commits into from
Jul 27, 2023

Conversation

ianpittwood
Copy link
Collaborator

@ianpittwood ianpittwood commented Jul 20, 2023

Closes #586

Workflow Changes

  • Creates
    • A new action, .github/actions/build-test-scan-push, which builds a specified image, tests it using Goss, scans it with Snyk, and pushes it. The last three steps are optional and can be enabled/disabled based on the needs of the user or workflow.
    • 3 new primary workflows
      • build-release.yaml - Builds the base image, base image w/ pro drivers, and then each product image utilizing the above action. This pipeline will trigger on merges and on a scheduled basis to keep images up to date with security patches, something we lacked on the previous revision. Replaces build-latest.yaml.
      • build-prerelease.yaml - Builds preview/daily images for each product as defined in the workflow matrix. Replaces build-preview.yaml.
      • build-manual.yaml - Allows repository administrators to perform one off manual builds of daily, preview, and release builds. This workflow is still in development and will likely need future work. The hope is that having this workflow will give us a quicker way of updating previously built images. Replaces build-preview-webhook.yaml.
    • Content image builds also now use .github/actions/build-test-scan-push, but have otherwise remained unchanged.
    • Adds retry logic for all builds to prevent one-off failures (e.g. network timeouts) from requiring human intervention.
    • Removed all ci.Justfile build shortcuts that were being used by previous workflows and replaces them with shortcuts for getting arguments and tags for each image.
  • Miscellaneous Changes
    • Changes caching method from local caching to Github Actions caching. Github Actions caching should be less error prone for large images since it handles purges of older cache data for us.
    • Much of our usages of just have been removed in favor of official Github Action calls. The primary driver for this change was a bug with using buildx in Github Actions that caused properly exported images to disappear in later steps, causing things like tests to fail.
    • Slight changes to workflow naming for readability.

Other Changes

  • Creates
    • A new target in the Justfile for updating Quarto versions across the project. This should stop Quarto from getting out of date across projects.
  • Upgrades
    • All Python versions are now up to the latest security/bug fixes on their respective versions. The default versions have been changed to 3.9.17 and 3.8.17 (alternate). CentOS 7 builds are pinned back to 3.9.14 and 3.8.15, the distribution's latest successful builds.
    • Defaults of R 3.6.x have been removed and replaced with 4.2.3 and 4.1.3 (alternate).
  • Miscellaneous Changes
    • Changed all usages of JUPYTER_PYTHON_VERSION to PYTHON_VERSION_JUPYTER for consistency.
    • Added trimSuffix "-1" for pro driver version Goss tests on RHEL-based systems.
    • Changed rstudio-connect.gcfg to replace Python versions with the primary version the image is built with at build time.
    • Cleans up version updates in Justfile and fixes blindspots. Ran after fixing so all versions are up to date.

@ianpittwood ianpittwood marked this pull request as ready for review July 26, 2023 16:33
Copy link
Contributor

@bschwedler bschwedler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this. Having common build steps across all the images should be very helpful.

I had just a few comments, but none of them need to be addressed before merging.

.github/workflows/build-prerelease.yaml Show resolved Hide resolved
.github/workflows/build-manual.yaml Outdated Show resolved Hide resolved
.github/workflows/build-content.yaml Outdated Show resolved Hide resolved
.github/workflows/build-release.yaml Show resolved Hide resolved
Justfile Show resolved Hide resolved
ci.Justfile Outdated Show resolved Hide resolved
Co-authored-by: Benjamin R. J. Schwedler <[email protected]>
Copy link
Contributor

@cm421 cm421 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for refactoring all of this!

@ianpittwood ianpittwood merged commit 11f5f51 into dev Jul 27, 2023
90 of 91 checks passed
@ianpittwood ianpittwood deleted the workflow-refactor branch July 27, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Github Action workflows for reusability and stability
3 participants